package com.accenture.agreco;

import com.accenture.agreco.beans.impl.ClasseImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        ApplicationContext context = javaDefinedAppContext();
        ClasseImpl terza_f = (ClasseImpl) context.getBean("terzaF");
        System.out.println(terza_f);
    }

    private static ApplicationContext javaDefinedAppContext() {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
        ctx.register(SchoolConfig.class);
        ctx.refresh();
        return ctx;
    }

    private static ApplicationContext xmlDefinedAppContext() {
        return new ClassPathXmlApplicationContext("Modulo-Spring.xml");
    }
}
